package com.iring.domain.common;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Generated;
import org.hibernate.annotations.GenerationTime;

/**
 * 操作记录实体
 *
 * @author wanggan
 */
@Entity
@Table(name = "t_operate_log")
public class OperateLog implements Serializable {

    private static final long serialVersionUID = 4914278104728435923L;

    @Id
    @GeneratedValue
    @Column(name = "id")
    private Integer id;

    @Column(name = "username")
    private String username;

    @Column(name = "operation_event")
    private String operationEvent;

    @Column(name = "operation_ip")
    private String operationIp;

    @Column(name = "operation_time",insertable = false,updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    @Generated(GenerationTime.INSERT)
    private Date operationTime;

    @Column(name = "operation_result")
    private Boolean operationResult;

    @Column(name = "remark")
    private String remark;

    @Override
    public String toString() {
        return "{id:" + id + ",username:" + username + ",operationEvent:" + operationEvent + ",operationIp:" + operationIp + ",operationTime:" + operationTime + ",operationResult:" + operationResult + ",remark:" + remark + "}";
    }

    public Integer getId() {
        return id;
    }

    public String getUsername() {
        return username;
    }

    public String getOperationEvent() {
        return operationEvent;
    }

    public String getOperationIp() {
        return operationIp;
    }

    public Date getOperationTime() {
        return operationTime;
    }

    public Boolean getOperationResult() {
        return operationResult;
    }

    public String getRemark() {
        return remark;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setOperationEvent(String operationEvent) {
        this.operationEvent = operationEvent;
    }

    public void setOperationIp(String operationIp) {
        this.operationIp = operationIp;
    }

    public void setOperationTime(Date operationTime) {
        this.operationTime = operationTime;
    }

    public void setOperationResult(Boolean operationResult) {
        this.operationResult = operationResult;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
